Remove v3.9 and add v3.14#3115
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Sanic's Python version support by removing Python 3.9 and adding Python 3.14 support. It includes modernizing type annotations to use PEP 604 syntax (| instead of Union/Optional), updating version checks for Python 3.14 compatibility, and updating configuration across build and test systems.
Key changes:
- Minimum Python version increased from 3.9 to 3.10
- Type annotations modernized to use PEP 604 union syntax (
|instead ofUnion/Optional) - Python 3.14 compatibility changes for asyncio API changes
Reviewed changes
Copilot reviewed 78 out of 78 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Updated test environment list to remove py39 and add py314 |
| setup.py | Updated python_requires and classifiers to reflect new version range |
| pyproject.toml | Updated ruff target-version to py310 |
| .github/workflows/tests.yml | Updated CI matrix to test Python 3.10-3.14 instead of 3.9-3.13 |
| sanic/worker/*.py | Modernized type annotations and added from __future__ import annotations |
| sanic/server/protocols/http_protocol.py | Added version check for Python 3.14's Task.cancel() API change |
| sanic/server/websockets/impl.py | Changed asyncio.get_event_loop() to get_running_loop() |
| sanic/server/async_server.py | Removed deprecated loop parameter from ensure_future() |
| sanic/app.py | Added version check for Task.cancel() and listener deprecation warning |
| sanic/*.py (many files) | Modernized type annotations throughout codebase |
| README.rst, guide files | Updated documentation to reflect Python 3.10+ requirement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3115 +/- ##
=============================================
+ Coverage 87.877% 87.893% +0.015%
=============================================
Files 105 105
Lines 8076 8078 +2
Branches 1280 1281 +1
=============================================
+ Hits 7097 7100 +3
+ Misses 674 671 -3
- Partials 305 307 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I've been waiting for this one for a looooooong time.